<admintpl file="header" />
	<style>
		.center {
			text-align: center!important;
		}
	</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">轮播列表</a></li>
			<li><a href="{:U('Slideshow/Adminslideshow/add')}" target="_self">添加轮播</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Slideshow/Adminslideshow/slide_show_list')}">
			位置：
			<select name="position" style="width: 120px;">
				<option value='0'>全部</option>
				<volist name="slide_show_positions" id="vo">
					<option value="{$key}" {$formget['position'] == $key ? 'selected' : ''}>{$vo}</option>
				</volist>
			</select>&nbsp;
			时间：
			<input type="text" name="start_time" class="js-datetime" value="{$formget.start_time|default=''}" style="width: 120px;" autocomplete="off">-
			<input type="text" class="js-datetime" name="end_time" value="{$formget.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp;
			关键字： 
			<input type="text" name="keyword" style="width: 200px;" value="{$formget.keyword|default=''}" placeholder="请输入关键字...">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Slideshow/Adminslideshow/slide_show_list')}">清空</a>
		</form>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th>标题</th>
						<th width="150">发布时间</th>
						<th width="50">状态</th>
						<th width="70">操作</th>
					</tr>
				</thead>
				<foreach name="posts" item="vo">
					<tr>
						<td><input data-id="{$vo.id}" class="input input-order" type="text" size="5" value="{$vo.post_order}"></td>
						<td>{$vo.id}</td>
						<td>{$vo.post_title}</td>
						<td>{:date('Y-m-d H:i',strtotime($vo['post_date']))}</td>
						<td>
							<php>$status = array('0' => '未审核', '1' => '正常', '2' => '审核未通过')</php>
							{$status[$vo['post_status']]}
						</td>
						<td>
							<a href="{:U('Slideshow/Adminslideshow/edit_slide_show', array('id' => $vo['id']))}">编辑</a> |
							<a href="{:U('Slideshow/Adminslideshow/del_slide_show', array('id' => $vo['id']))}" class="js-ajax-delete">删除</a>
						</td>
					</tr>
				</foreach>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(document).ready(function () {
			$('body').delegate('.input-order', 'change', function () {
			    var order 	= $(this).val();
			    var id 		= $(this).attr('data-id');
			    $.get("{:U('Portal/AdminPost/change_post_order')}", {id : id, order : order}, function (data) {
					if (data.status) {
					    window.location.reload();
					}
                })
            })
        })
	</script>
</body>
</html>